<template>
    <div class="kw-table-cell">
        <template v-if="renderType === 'normal'">{{row[column.key]}}</template>
        <template v-else-if="renderType === 'render'">
            <column-render :index="index" :row="row" :column="column" :render="column.render"></column-render>
        </template>
    </div>
</template>
<script>
import ColumnRender from './KwTableColumnRender'
export default {
    name: 'kw-table-column',
    components: {ColumnRender},
    props: {
        index: Number,
        row: Object,
        column: Object,
    },
    data() {
        return {
            renderType: 'normal'
        }
    },
    created() {
        if (this.column.render) {
            this.renderType = 'render'
        }
    }
}
</script>